<%@ page language="java" contentType="text/html;UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="com.bear.model.entity.User" %>
<%@ page import="com.bear.model.entity.plan.*" %>
<%@include file="../base.jsp" %>

<title>我的计划</title>

</head>
<script>
function open1()
{
	$("#waddplan").window('open');
}
function newplan()
{
	$("#ff").submit();
}

function close1()
{
	$("#waddplan").window('close');
}

</script>


<style type="text/css">

.load{
width:397px;
height:49px;
background:url('<c:url value="/ico/image/bak.png"/>') no-repeat;
}
.load div{
width:0px;
height:48px;
background:url('<c:url value="/ico/image/pro.png"/>') no-repeat;
color:#fff;
text-align:center;
font-family:Tahoma;
font-size:18px;
line-height:48px;
}

</style>
<%List<Plan> plans =  (List<Plan>)request.getAttribute("plans");%>
<body>
<img src="<c:url value="/ico/egg.jpg"/>" height="50"><font class="thick">计划与任务</font><br>


<div class="demo-info">
	<div class="demo-tip icon-tip"></div>
	<div>看看我的计划完成了多少</div>
</div>		
<a href="<c:url value="/App.html"/>" class="easyui-linkbutton" >首页</a>
<a href="#" class="easyui-linkbutton" onclick="open1()">新建一个计划</a><br><br>


<%if(plans!=null&&plans.size()>0){ %>
<%for(Plan plan:plans){ %>
<div><font color="green" ><strong><%=plan.getDetail() %></strong></font><br>
<a href="<c:url value="/plan/detail.html"/>?planid=<%=plan.getId() %>" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-search'">计划详情</a>
<a href="<c:url value=""/>" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-cancel'">删除计划</a>
<div id="loading<%=plan.getId()%>" class="load" ><div>
</div>
</div>
</div> 
<script>
$("#loading<%=plan.getId()%> > div").css("width", String(<%=plan.getPercent()%>) + "%");
$("#loading<%=plan.getId()%> > div").html(String(<%=plan.getPercent()%>) + "%");
</script>
<br>
<%}
}else
{%>
<font color="green" ><strong>你还没有什么计划，新建一个计划吧！</strong></font>
<%
}%>	


<div id="waddplan" class="easyui-window" data-options="title:'增加计划',closed:true" style="width:400px;height:270px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'center',border:false" style="padding:10px;background:#fff;border:1px solid #ccc;">
			<!-- 表单-->
			<div style="background:#fafafa;padding:10px;width:300px;height:150px;">
	    	<form id="ff" method="post" novalidate action="<c:url value="/plan/addplan.html"/>">
	        <div>
	            <label for="plan">计划内容:</label><br>
	            <textarea name="detail" style="height:100px;width:290px;resize: none;" name="sign" ></textarea>
	        </div>
	    	</form>
	    	</div>
	    	</div>
	    	<!-- 表单完-->
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:newplan()">保存</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:close1()">取消</a>
			</div>
		</div>
</div>

<%@include file="../botton.jsp" %>
</body>
</html>